import request from "@/utils/request";
export interface postForm {
  id?: number;
  title?: string;
  content?: string;
  createTime?: string;
  studentUserName?: string;
  studentAvatar?: string;
  formatDate?: string;
  tagId?: number;
  tagName?: string;
}
export interface postMainForm {
  id?: number;
  content?: string;
  postTime?: string;
  studentUsername?: string;
  postId?: number;
  avatar?: string;
  formatDate?: string;
}
//   所有主题帖
export const getAllPosts = () => {
  return request.get("/post/allPost");
};
//   主题帖下的用户回复
export const getPostsMains = (postId: number) => {
  return request.get(`${"/post/postMainByPostId"}/${postId}`);
};
export const createPost = (newpost: postForm) => {
  return request.post("/post/createPost", newpost);
};
export const createPostMain = (newpostMain: postMainForm) => {
  return request.post("/post/createPostMain", newpostMain);
};
